package com.proxy.scanandcheck.common.valueobject;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

public class ProxyRequest implements Serializable{
	
	private static final long serialVersionUID = 362040741497861429L;
	
	public static final String A_CLASS = "a";
	public static final String B_CLASS = "b";
	public static final String C_CLASS = "c";
	public static final String ALL_CLASS = "all";
	public static final String BUTTON_DISABLED_CSS = "disabled";
	public static final String BUTTON_ENABLED_CSS = "";
	
	private String ipClass;
	private int threadCount;
	private String keyWords;
	private String startButtonCss = "";
	private String stopButtonCss = "";
	
	
	public String getIpClass() {
		return ipClass;
	}
	public void setIpClass(String ipClass) {
		this.ipClass = ipClass;
	}
	public int getThreadCount() {
		return threadCount;
	}
	public void setThreadCount(int threadCount) {
		this.threadCount = threadCount;
	}
	
	public String getStartButtonCss() {
		return startButtonCss;
	}
	public void setStartButtonCss(String startButtonCss) {
		this.startButtonCss = startButtonCss;
	}
	public String getStopButtonCss() {
		return stopButtonCss;
	}
	public void setStopButtonCss(String stopButtonCss) {
		this.stopButtonCss = stopButtonCss;
	}
	public String getKeyWords() {
		return keyWords;
	}
	public void setKeyWords(String keyWords) {
		this.keyWords = keyWords;
	}
	
	public List<String> getKeyWordsList()
	{
		String [] wordsArray = this.keyWords.split(",");
		return Arrays.asList(wordsArray);
	}
	
	public int hashCode() {
		return super.hashCode();
	}
	public String toString() {
		return "IP_CLASS: " + ipClass + ", THREAD_COUNT: " + threadCount;
	}
	
	public ProxyRequest cloneProxyRequest()
	{
		ProxyRequest proxyRequest = new ProxyRequest();
		proxyRequest.setIpClass(ipClass);
		proxyRequest.setKeyWords(keyWords);
		proxyRequest.setStartButtonCss(startButtonCss);
		proxyRequest.setStopButtonCss(stopButtonCss);
		proxyRequest.setThreadCount(threadCount);
		return proxyRequest;
	}

}
